﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace ZoneLine.Views
{
    public class TextBoxD : TextBox
    {


        public bool IsFocus
        {
            get { return (bool)GetValue(IsFocusProperty); }
            set { SetValue(IsFocusProperty, value); }
        }

        // Using a DependencyProperty as the backing store for IsFocus.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IsFocusProperty =
            DependencyProperty.Register("IsFocus", typeof(bool), typeof(TextBoxD), new PropertyMetadata(false));


        public TextBoxD()
        {
            this.LostFocus += TextBoxD_LostFocus;
            this.GotFocus += TextBoxD_GotFocus;
        }

        private void TextBoxD_GotFocus(object sender, RoutedEventArgs e)
        {
            IsFocus = true;
        }

        private void TextBoxD_LostFocus(object sender, RoutedEventArgs e)
        {
            IsFocus = false;
        }
    }
}
